<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>fontAvailable tests, 1.0</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css" media="screen">
	*, html, body, table {
	  font-family: arial;
	  font-size: 13px;
	}
	dd {
	  display: inline
	}
	.pass {
	  background-color: green;
	  color: white;
	}
	.fail {
	  background-color: red;
	  color: white;
	}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery.fontavailable.js"></script>
</head>
<body>

<dl>
	<dt>Font:</dt>
	<dd id="font-name">n/a</dd>
	<dt>Status:</dt>
	<dd id="font-status">n/a</dd>
</dl>

<ul id="assertion-log"></ul>

<script type="text/javascript">
    function assert( name, validity ) {
		$('#assertion-log').append(['<li>',name,': ', validity ? 'Pass' : ('Fail'),'</li>'].join(''));
    }

	function test_font(fontName) {
		var status = $.fontAvailable( fontName ) ? 'Pass' : 'Fail';
		
		$('#font-name').html( fontName );
		$('#font-status').html( status ).attr('class', status.toLowerCase());
	}
	
	$(document).ready(function() {
		test_font('arial');
		
		assert('default font', $.fontAvailable('arial'));
		assert('invalid font', !$.fontAvailable('my fake font'));

	});
	
</script>

</body>
</html>